package dcutils.cards.mtg;

// Import JDK Classes
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
* Represents all the base mana types in Magic the Gathering.<br/>
* @author dca
*/
public enum BaseMana implements Mana, Iterable<BaseMana> {
	WHITE("white", "Plain"),
	BLUE("blue", "Island"),
	GREEN("green", "Forest"),
	RED("red", "Mountain"),
	BLACK("black", "Swamp");

	/** The name of the mana.<br/> */
	private String name;

	/** The name of the land associated with the mana.<br/> */
	private String land;

	/**
	 * The constructor initializes the name and the land.<br/>
	 * @param name The name of the mana.<br/>
	 * @param land The name of the land associated with the mana.<br/>
	 */
	private BaseMana(String name, String land) {
		this.name = name;
		this.land = land;
	} // END constructor

	/**
	 * The getter for the name of the mana.<br/>
	 * @return name The name of the mana.<br/>
	 */
	public String getName() {
		return this.name;
	} // END getName

	/**
	 * The getter for the name of the land associated with the mana.<br/>
	 * @return land The name of the land associated with the mana.<br/>
	 */
	public String getLand() {
		return this.land;
	} // END getLand

	/**
	 * Returns an array of all enum values.<br/>
	 * @return BaseMana[] An array of all enum values.<br/>
	 */
	public static BaseMana[] asArray() {
		return values();
	} // END asArray

	/**
	 * Returns a list of all enum values.<br/>
	 * @return List<BaseMana> A list of all enum values.<br/>
	 */
	public static List<BaseMana> asList() {
		return Arrays.asList(asArray());
	} // END asList

	/**
	 * Returns an iterator over all enum values.<br/>
	 * @return Iterator<BaseMana> An iterator over all enum values.<br/>
	 */
	@Override
	public Iterator<BaseMana> iterator() {
		return asList().iterator();
	} // END iterator

	/**
	 * The getter for the name of the mana.<br/>
	 * @return name The name of the mana.<br/>
	 */
	@Override
	public String toString() {
		return getName();
	} // END toString
} // END enum BaseMana
